// Marty Stepp, CSE 142, Winter 2008, Section XYZ // This program prints a square of numbers using nested loops. // public class NestedLoops { public static void main(String[] args) { for (int line = 1; line <= 5; line++) { for (int j = 1; j <= (-1 * line + 5); j++) { System.out.print("."); } System.out.print(line); for (int k = 1; k <= (line - 1); k++) { System.out.print("."); } System.out.println(); // end the line } } }